package com.aoxon.cargo.component;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ListView;
import android.widget.ProgressBar;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.aoxon.cargo.R;


/**
 * 列表底部的显示
 * @author ZZJ
 *
 */
public class MyListBottom {

	private LayoutInflater layoutInflater;
	private RelativeLayout layout;
	private ProgressBar progressBar;
	private TextView textView;
	
	public MyListBottom(Context context,ListView listView){
		this.layoutInflater = LayoutInflater.from(context);
		layout = (RelativeLayout) layoutInflater.inflate(R.layout.pub_list_bottom, null);
		progressBar = (ProgressBar) layout.findViewById(R.id.pbListBottom);
		textView = (TextView) layout.findViewById(R.id.tvListBottom);
		listView.addFooterView(layout);
	}

	
	public void showProgressBar(){
		progressBar.setVisibility(View.VISIBLE);
	}
	
	public void hideProgressBar(){
		progressBar.setVisibility(View.GONE);
	}
	
	public void setText(String text){
		textView.setText(text);
	}
	
	public void hideListBottom(){
		layout.setVisibility(View.GONE);
	}
	
}

